/* 
 * File:   mystruct.h
 * Author: zhongfeng
 *
 * Created on 03 二月 2010, 下午 02:07
 */

#ifndef _MYSTRUCT_H
#define	_MYSTRUCT_H

#include <string.h>
#include <iostream>
#include "mycommon.h"

#define MAXNUM 100
using namespace std;



struct CellStruct {
    int mnid;
    char ch[MAXNUM];

    CellStruct() {
        mnid = -1;
        INITIAL(ch, '\0', MAXNUM);
    }
    CellStruct(int id, string str) {
        mnid = id;
        str.copy(ch, 0, MAXNUM);
        ch[MAXNUM] = '\0';
    }
    void assignValue(int id, string str){
        mnid = id;
        str.copy(ch, 0, MAXNUM);
        ch[MAXNUM] = '\0';
    }

    ostream &
    operator <<(ostream& os) {
        os << "id: " <<mnid << " str: " << ch;
        return os;
    }
};



#endif	/* _MYSTRUCT_H */

